package com.shopping.service.impl;

import com.shopping.bean.Administrator;
import com.shopping.bean.User;
import com.shopping.dao.AdminDao;
import com.shopping.service.IAdminService;
import com.shopping.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminService implements IAdminService {

    @Autowired
    AdminDao adminDao;
    @Override
    public Administrator getAdminByID(Integer id) {
        return adminDao.getAdminByID(id);
    }

    @Override
    public int editAdmin(Administrator administrator) {
        return adminDao.editAdmin(administrator);
    }

    @Override
    public Administrator getAdmin(Administrator administrator) {
        return adminDao.getAdminByAdminname(administrator.getAdminname());
    }

    @Override
    public int add(Administrator administrator) {
        return adminDao.add(administrator);
    }

    @Override
    public List<Administrator> getAdminList(String text, Page page) {
        return adminDao.getAdminList(text, page);
    }

    @Override
    public int getAdminCount(String text) {
        return adminDao.getAdminCount(text);
    }

    @Override
    public int deleteAdmin(Integer adminid) {
        return adminDao.deleteAdmin(adminid);
    }
}
